<?php

class PasswordGenerator
{

  public function __construct ()
  {
  
  }

  /**
   * @param integer $length
   * @return string
   */
  public function generate ($length = 8)
  {
    $base_code = md5(uniqid(rand(), true));
    return substr($base_code, 0, $length);
  }
}